/****************************************************************************
	This file is part of Basqet.

	Basqet is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	Basqet is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
    along with Basqet.  If not, see <http://www.gnu.org/licenses/>.

****************************************************************************/

#ifndef TEXTNOTEDATA_H
#define TEXTNOTEDATA_H

#include "notedata.h"

#include <QString>
#include <QSize>
#include <QPoint>

#include <QDomElement>
#include <QTextDocument>
#include <QFileInfo>


class TextNoteData : public NoteData
{
	Q_OBJECT

	public:
		TextNoteData(BasketDescriptor* container, BasketContent* content);
		virtual void setup(QDomElement tag);
		virtual void copyFrom(const NoteData* other);

		virtual bool removeNote();

		void setHeaderBodySliderSizes(QList<int> sizes);
		QList<int> getHeaderBodySliderSizes() const;

		QTextDocument* getDocument();
		QTextDocument* getHeaderDocument();


		virtual void getContents(QMap<QString, QVariant>& contents);
		virtual void setContents(const QMap<QString, QVariant>& contents);

	public slots:
		void save();

	signals:
		void headerBodySliderResized(const QList<int>& sizes);

	protected:
		void readFromHTML();
		void saveToHTML();

	protected:
		QFileInfo			mDocumentFile;
		QFileInfo			mHeaderFile;

		QTextDocument		mHeaderDocument;
		QTextDocument		mTextDocument;

		QDomAttr			mHeaderBodySliderSizes;

};

#endif // TEXTNOTEDATA_H
